// 封装axios
import axios from 'axios'
import cookie from 'js-cookie'
// 创建axios实例
const service=axios.create({
  // baseURL: 'http://localhost:9001',
  baseURL: 'http://119.3.83.202:9001',
 timeout:20000,// request timeout
 headers: {
     'Content-Type': "application/json;charset=utf-8",
     'Access-Control-Allow-Credentials':"false"//1
   },
   withCredentials:false//2
})
//拦截器
service.interceptors.request.use(config => {
  //debugger
  if(cookie.get('uiuser_token')){
    config.headers['token']=cookie.get('uiuser_token')
  }
  return config;
}, err=> {
  return Promise.reject(err)
}
)
export default service
